-
Notifications
You must be signed in to change notification settings - Fork 3k
refactor: move streamable HTTP app creation from FastMCP to lowlevel Server #1899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
maxisbey
wants to merge
5
commits into
main
Choose a base branch
from
refactor/streamable-http-app-location
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+205
−122
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Move StreamableHTTPASGIApp from fastmcp/server.py to streamable_http.py - Move streamable_http_app() implementation from FastMCP to lowlevel Server - Add session_manager property to lowlevel Server, FastMCP delegates to it - Fix circular import by using TYPE_CHECKING in streamable_http_manager.py Claude-Generated-By: Claude Code (cli/claude-opus-4-5=100%) Claude-Steers: 8 Claude-Permission-Prompts: 1 Claude-Escapes: 0
Move StreamableHTTPASGIApp from streamable_http.py to streamable_http_manager.py since it directly depends on StreamableHTTPSessionManager. Claude-Generated-By: Claude Code (cli/claude-opus-4-5=100%) Claude-Steers: 0 Claude-Permission-Prompts: 2 Claude-Escapes: 0
Claude-Generated-By: Claude Code (cli/claude-opus-4-5=100%) Claude-Steers: 0 Claude-Permission-Prompts: 1 Claude-Escapes: 0
Claude-Generated-By: Claude Code (cli/claude-opus-4-5=100%) Claude-Steers: 1 Claude-Permission-Prompts: 1 Claude-Escapes: 0
…evel streamable_http_app() Claude-Generated-By: Claude Code (cli/claude-opus-4-5=100%) Claude-Steers: 0 Claude-Permission-Prompts: 1 Claude-Escapes: 1
Kludex
reviewed
Jan 18, 2026
Comment on lines
+225
to
+239
| ### `StreamableHTTPASGIApp` moved to `streamable_http_manager` module | ||
|
|
||
| The `StreamableHTTPASGIApp` class has been moved from `mcp.server.fastmcp.server` to `mcp.server.streamable_http_manager`. | ||
|
|
||
| **Before (v1):** | ||
|
|
||
| ```python | ||
| from mcp.server.fastmcp.server import StreamableHTTPASGIApp | ||
| ``` | ||
|
|
||
| **After (v2):** | ||
|
|
||
| ```python | ||
| from mcp.server.streamable_http_manager import StreamableHTTPASGIApp | ||
| ``` |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that is supposed to have been public. No note needed for this.
Kludex
approved these changes
Jan 18, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Moves the Starlette app creation logic for streamable HTTP transport from FastMCP down to the lowlevel Server, and relocates
StreamableHTTPASGIApptostreamable_http_manager.py.Changes
Move
streamable_http_app()implementation to lowlevel Server: The Starlette app creation (routes, middleware, auth setup) now lives in the lowlevelServerclass. FastMCP's method becomes a thin wrapper that passes through its settings.Move
StreamableHTTPASGIApptostreamable_http_manager.py: This ASGI app class directly wrapsStreamableHTTPSessionManager, so it belongs in the same module.Add
session_managerproperty to lowlevel Server: Exposes the session manager afterstreamable_http_app()is called. FastMCP's property now delegates to this.Fix circular import: Use
TYPE_CHECKINGinstreamable_http_manager.pyfor theServerimport since it's only needed for type annotations.Why
The lowlevel Server shouldn't depend on FastMCP. Previously, it imported
StreamableHTTPASGIAppfrom FastMCP, inverting the expected dependency hierarchy. This refactor ensures dependencies flow in one direction: FastMCP → lowlevel.